import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import * as path from "path";


// https://cn.vitejs.dev/config/
export default defineConfig({
    plugins: [vue()],

    resolve: {
        // 配置路径别名
        alias: {
            '@': path.resolve(__dirname, './src'),
        },
    },

    //引入全局SCSS文件
    css: {
        preprocessorOptions: {
            scss: {
                /**如果引入多个文件，可以使用
                 * '@import "@/assets/scss/globalVariable1.scss";
                 * @import"@/assets/scss/globalVariable2.scss";'
                 **/
                additionalData: '@import "@/styles/index.scss";', //引入scss文件
            }
        }
    },

    server: {
        //启动时，自动打开浏览器
        open: '/',
    },
})
